﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AdvanceLib.ScriptCore
{
    public class ScriptSection
    {
        #region Constructors
        public ScriptSection()
        {
            this.Name = string.Empty;
            this.Commands = new List<ICommand>();
        }
        #endregion

        #region Properties
        public string Name { get; set; }
        public string Source { get; set; }
        public long Offset { get; set; }
        public int Size { get; set; }
        public int Line { get; set; }
        public List<ICommand> Commands { get; set; }
        public ISystemSection SystemSection { get; set; }
        #endregion

        #region Methods
        public void CalculateSize()
        {
            this.Size = 0;

            foreach (ICommand command in this.Commands)
                this.Size += command.GetLength();
        }
        #endregion
    }
}
